package jiang.jredis;

import jiang.jredis.starter.annotation.EnableChannel;
import jiang.jredis.starter.annotation.EnableDoubleCaching;
import jiang.jredis.starter.annotation.EnableLocking;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

@SpringBootApplication
@EnableDoubleCaching
@EnableChannel
@EnableLocking
public class JRedisApplication {

    @Bean
    public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
        ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
        threadPoolTaskExecutor.setCorePoolSize(6);
        threadPoolTaskExecutor.setMaxPoolSize(6);
        threadPoolTaskExecutor.setQueueCapacity(100);
        return threadPoolTaskExecutor;
    }

    public static void main(String[] args) {
        SpringApplication.run(JRedisApplication.class, args);
    }

}
